package com.niiwoo.civet.mobile.controller;/**
 * Created by DELL on 2017/11/24.
 */

import com.niiwoo.tripod.web.shiro.UserAuthPrincipal;
import org.apache.shiro.SecurityUtils;
import org.springframework.web.bind.annotation.RestController;

/**
 * Controller基类
 *
 * @author xiaoyingping
 * @create 2017-11-24 18:30
 **/
@RestController
public class BaseController {

    static String getUserIdFromAuth(){
        UserAuthPrincipal principal = (UserAuthPrincipal) SecurityUtils.getSubject().getPrincipal();
        return String.valueOf(principal.getUserId());
    }

}
